package com.university.report.user.controller;

import com.university.report.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName health_report
 * @Author Jinondo
 * @Date 2021/6/17 15:53
 */
@RestController
@Slf4j
public class ErrorController {
    @RequestMapping("/error/400")
    public Result error400(){
        return Result.build(400,"400 ERROR! Bad Request ! Check your request params Please");
    }

    @RequestMapping("/error/401")
    public Result error401(){
        return Result.build(401,"you are trying to access the resource has not been authenticated " +
                "or has not been authenticated correctly");
    }

    @RequestMapping("/error/403")
    public Result error403(){
        log.info("---------------403------------------");
        return Result.build(403,"403 ERROR! Hey man. You have no permissions to access orz!");
    }

    @RequestMapping("/error/404")
    public Result error404(){
        return Result.build(404,"404 ERROR! I can't find the sources by this path orz!");
    }

    @RequestMapping("/error/500")
    public Result error500(){
        log.info("---------------500------------------");
        return Result.build(500,"500 ERROR! The Server counter some errors!\nCall the developer to find the bug orz");
    }
}
